package adc.app.spec;


/**
 * This is the prototype of the business service that handles authentication.
 * 
 * @author alexandru.deac
 * 
 */
public interface IAutheBs<T extends IUser> extends ISecuredBs, IPersistenceBs<T> {
	/**
	 * Try to login an user with the given credentials.
	 * 
	 * @param username
	 *            the username
	 * @param password
	 *            the password
	 * @throws InvalidCredentialException
	 *             if the credentials are invalid
	 * @throws BsException
	 *             if another business exception occurs
	 */
	public void login(String username, String password)
			throws InvalidCredentialException, BsException;

	/**
	 * Logout the currently authenticated user.
	 * 
	 * @throws BsException
	 *             if an error occurs
	 */
	public void logout() throws BsException;
}
